package com.aitaoxue.palx.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

import com.aitaoxue.palx.R;

public class TestFragment extends Fragment implements OnClickListener{

	private Button btn = null;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.test_fragment, null);

		btn = (Button) view.findViewById(R.id.test_fragment_btn);
		btn.setOnClickListener(this);

		return view;
	}

	@Override
	public void onClick(View view) {
		System.out.println("here");
		
		switch (view.getId()) {
		case R.id.test_fragment_btn:

//			RongIM.getInstance()
//					.getRongIMClient()
//					.sendMessage(ConversationType.PRIVATE, "18710959111",
//							TestMessage.obtain("haha"), null, null,
//							new SendMessageCallback() {
//
//								@Override
//								public void onSuccess(Integer arg0) {
//									System.out.println(arg0);
//									
//								}
//
//								@Override
//								public void onError(Integer arg0, ErrorCode arg1) {
//									System.out.println(arg1);
//								}
//							});

			Toast.makeText(getActivity(), "send", Toast.LENGTH_SHORT).show();

			break;

		default:
			break;
		}
	}

	

}
